home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / lnx.doc < prev    next >
Text File  |  1995-03-31  |  6KB  |  127 lines

  1. (User.programs) 
  2. Item: 145 by _rjs at hpcvbbs.UUCP 
  3. Author: [rj schwartz] 
  4.   Subj: BASE OF NATURAL LOG (e) TO N PLACES 
  5.   Date: Tue Nov 06 1990 10:49  
  6.  
  7. BASE OF NATURAL LOG (e) TO N PLACES... 
  8.   
  9.  The program below produces a vector containing 10 digit integers which 
  10.   represent the fractional part of 'e' (.71828...). 
  11.    
  12.  The program takes a single argument (from level 1) which is a positive 
  13.   integer divisible by 10.  The argument specifies the number of decimal 
  14.   places that are to be determined. 
  15.   
  16.  Note - due to truncation the last few decimal places may be incorrect - 
  17.   for up to 150 digits the last 2 may be incorrect, above that and up to 
  18.   2500 digits the last 3 may be incorrect and above that and up to 35000 
  19.   digits the last 4 may be incorrect. 
  20.     
  21.  The time to produce 30 digits (28 accurately) on the HP48SX w/ROM-D 
  22.   is 30 secs.  A similar program written some years ago for the HP-65 
  23.   took 210 secs to produce 32 digits. 
  24.   
  25.  I've written a PC based programmable calculator program which, when run 
  26.   on a 33MHz 80386/80387, will generate 2000 digits in a little over 30 
  27.   mins.  An assembly language routine using the same algorithm and run 
  28.   on the same machine takes 1.2 secs.  I estimate that the HP48SX would 
  29.   take on the order of 15 hrs. to produce this many digits and the result 
  30.   may be incorrect - it depends on the precision of the internal floating 
  31.   point representation.  Does anyone know what the internal representation is?   
  32.   
  33.  The correct fractional part to 2000 decimal places (actually 1996) 
  34.   follows the program listing. 
  35.   
  36.  Also, let me know if you're interested in obtaining a copy of the PC based 
  37.   calculator mentioned above.  The documentation is incomplete, but I'll 
  38.   finish it if there's enough interest.  A brief description of the program 
  39.   features follows: 
  40.   
  41.               PC - Personal Computer Programmable Calculator 
  42.                       (c) 1989  RJ Schwartz    
  43.   
  44.  LIST OF FEATURES 
  45.   
  46.   .   Reverse Polish Notation (RPN) with 4 register stack plus "Last x" 
  47.        register. 
  48.   
  49.   .   15 - 16 digit accuracy, range - 1.E-308 to 1.E308, user  
  50.        defined display precision. 
  51.   
  52.   .   8000 data registers addressable directly or indirectly, 
  53.        4 function register arithmetic, increment (decrement) register. 
  54.     
  55.   .   100 general purpose flag (Boolean) registers: 
  56.          1 - 19   System flags 
  57.         20 - 39   Unaffected by flag test 
  58.         40 - 59   Cleared by flag test 
  59.         60 - 79   Set by flag test 
  60.         80 - 99   Complemented by flag test 
  61.       Flag operations - set, complement, test on, test off. 
  62.        System flags indicate data entry, stack lift status, 
  63.        print enable, print to file, error conditions. 
  64.   
  65.   .   Built in functions include trigonometrics in degree, radian, 
  66.        gradian or hyperbolic modes, e^x, ln x, 10^x, log x, abs, 
  67.        sgn, factorial, combinations and permutations, rect <-> polar 
  68.        conversions, integer, fraction, remainder, round, random 
  69.        number generator, reciprocal, square root, add, subtract, 
  70.        multiply, divide, exponentiate and more.  All functions can 
  71.        be included in programs. 
  72.   
  73.   .   10000 step program capacity - 6 conditional tests, 100 levels of 
  74.        nested subroutines, GOTO label, GOTO prog. step, relative jump, 
  75.        decrement or increment any data register with variable length  
  76.        jump on zero or non-zero.       
  77.   
  78.    .  Trace and/or time execution, single step, set breakpoint, 
  79.        variable length pause. 
  80.   
  81.   .   40 user defined keystroke Macros (up to 40 characters each). 
  82.   
  83.   .   Save (Load) registers, macros and/or flags to (from) disk. 
  84.   
  85.   .   Formatted print (numeric or string data) to printer or to disk. 
  86.   
  87.   .   Display graphs of user defined functions. 
  88.   
  89.   .   Variable length BEEP and TONE functions.   
  90.             
  91.   .   Statistical functions including mean, standard deviation, 
  92.        and linear regression. 
  93.   
  94.   .   Executes over 3000 program steps per second on an 80386 CPU @ 20 MHZ. 
  95.   
  96.   
  97.  HARDWARE REQUIREMENTS/RECOMENDATIONS 
  98.   
  99.     .  Requires computer with Intel 8088 or 80x86 CPU, Microsoft 
  100.         DOS version 3.1 or higher,  IBM compatible BIOS and CGA, EGA or 
  101.         VGA graphics. 
  102.   
  103.     .  Recommended are math coprocessor (80x87), a fast CPU and EGA or VGA 
  104.         graphics cards with color display. 
  105.   
  106.   
  107.  REQUEST FOR ASSISTANCE 
  108.   
  109.  I've just purchased the HP48 after many years away from HP calculators. 
  110.   (My last was the HP-65, which, incidentally, was stolen - does anyone 
  111.   have one for sale?).  Anyway, I see from comments on this BBS,  that 
  112.   low level programming is now possible on HP48 and some of its predecessors. 
  113.   Can someone please direct me to information on the following for the HP48: 
  114.       
  115.        1. The CPU architecture (including register sizes). 
  116.        2. The interrupt capabilities (is that what controls the clock 
  117.            and the keyboard?). 
  118.        3. The instruction set (I've seen some listings on this BBS but 
  119.            the adressing modes are foreign to me. eg. add.a  c,a). 
  120.        4. A list of ROM entry points (again I've seen partial listings 
  121.            but there seems to be much more information available). 
  122.        5. The internal structure of HP48 objects. 
  123.   
  124.  Thanks in advance 
  125.  
  126. [RJ: I'll bet Voyager is exactly what you've been waiting for!  -jkh-] 
  127.